package biz.datalk.industrialland.mbg.pojo.bo;

/**
 * 角色编码枚举
 *
 * @author tarofang@163.com
 * @date 2024-01-25
 */
public enum RoleCodeEnum {
    ADMIN("admin", "管理员"), //
    COMMON("common", "普通用户"), //
    ;

    private final String roleCode;
    private final String describe;

    RoleCodeEnum(String roleCode, String describe) {
        this.roleCode = roleCode;
        this.describe = describe;
    }

    public String getRoleCode() {
        return roleCode;
    }

    public String getDescribe() {
        return describe;
    }

    public static RoleCodeEnum parse(String roleCode) {
        String tmpRoleCode = roleCode == null ? null : roleCode.trim();
        if (tmpRoleCode == null) {
            return null;
        }
        for (RoleCodeEnum roleCodeEnum : RoleCodeEnum.values()) {
            if (roleCodeEnum.getRoleCode().equals(tmpRoleCode)) {
                return roleCodeEnum;
            }
        }
        return null;
    }

}
